package org.theqcp.wow.model.mechanics;

public enum ClassType {
	
	DEATHKNIGHT("deathknight"),
	DRUID("druid"),
	HUNTER("hunter"),
	MAGE("mage"),
	PALADIN("paladin"),
	PRIEST("priest"),
	ROGUE("rogue"),
	SHAMAN("shaman"),
	WARLOCK("warlock"),
	WARRIOR("warrior"),
	
	//for lulz
	ROUGE("rouge"),
	
	//for any
	UNKNOWN("unknown")	
	;
	
	private String name;
	
	private ClassType(String name) {
		this.name = name;
	}
	
	public String getName() {
		return this.name;
	}
	
	
	public static ClassType getClassFromName(String name) {
		
		//adjust name
		name = name.trim().toLowerCase().replace(" ", "");
		
		//return name
		for(ClassType c : ClassType.values()) {
			if(c.name.equals(name)) {
				return c;
			}
		}
		
		//return human as default
		return ClassType.SHAMAN;
	}
}
